<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>TodoList</title>
    <!-- 新 Bootstrap4 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>

    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>

    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
    <h2>TodoList</h2>
    <a class="btn btn-primary float-right" href="./add_page.html" th:href="@{./add}">Add</a>
    <table class="table">
        <thead>
        <tr>
            <th>Index</th>
            <th>Content</th>
            <th>Operations</th>
        </tr>
        </thead>
        <tbody th:remove="all-but-first">
        <tr th:each="todo:${todos}" >
            <td th:text="${todoStat.count}">1</td>
            <td th:text="${todo.content}">上午8点教二240上课</td>
            <td>
                <a type="button" class="btn btn-xs btn-success" href="./edit_page.html?id=1"
                   th:href="@{./edit(id=${todo.id})}">编辑</a>
                <a type="button" class="btn  btn-xs btn-danger" href="./delete?id=1"
                   th:href="@{./delete(id=${todo.id})}">删除</a>
            </td>
        </tr>
        <tr>
            <td>2</td>
            <td>下午2点教三130听报告</td>
            <td>
                <a type="button" class="btn  btn-xs btn-success" href="./edit_page.html?id=1">编辑</a>
                <a type="button" class="btn  btn-xs btn-danger" href="./delete?id=1">删除</a>
            </td>
        </tr>
        </tbody>
    </table>
</div>

</body>
</html>